<i><?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activIdsAdmin']))
{
	header("Location:checkLogin.php");
}
else
{
	$userId = ($_SESSION['s_activIdsAdmin']);
  $m=0;
  $invoiceArray = array();  
  if($_GET['invoiceNo'] > 0)
  {
    $selectContract = "SELECT  invoiceNo,qty,price,value,DATE_FORMAT(dateOfLoading,'%d-%m-%Y')AS dateOfLoading,vessel,
                               DATE_FORMAT(etdDate,'%d-%m-%Y')AS etdDate
                          FROM invoice
                         WHERE invoiceId = ".$_REQUEST['invoiceNo'];
                              
    $selectContractRes = mysql_query($selectContract);
    while($invoiceRow = mysql_fetch_array($selectContractRes))
    {
    	$invoiceArray[$m]['invoiceNo']      = $invoiceRow['invoiceNo'];
    	$invoiceArray[$m]['qty']            = $invoiceRow['qty'];
    	$invoiceArray[$m]['price']          = $invoiceRow['price'];
    	$invoiceArray[$m]['value']          = $invoiceRow['value'];
    	$invoiceArray[$m]['dateOfLoading']  = $invoiceRow['dateOfLoading'];
    	$invoiceArray[$m]['vessel']         = $invoiceRow['vessel'];
    	$invoiceArray[$m]['etdDate']        = $invoiceRow['etdDate'];
    	$m++;
    }
  }
}
include("bottom.php");
$smarty->assign("invoiceArray",$invoiceArray);
$smarty->display("getInvoiceDetail.tpl");
?></i>